package com.fastgeek.platform.db.datasource;


import java.util.Properties;

public class DBConfig {
	private String driver;
	private String url;
	private String userName;
	private String password;
	private boolean isDefault;
	private Properties configuration;

	public DBConfig(String driver, String url, String userName, String password) {
		this(driver, url, userName, password, false, null);
	}

	public DBConfig(String driver, String url, String userName,
			String password, boolean isDefault, Properties confProperties) {
		this.driver = driver;
		this.url = url;
		this.userName = userName;
		this.password = password;
		this.isDefault = isDefault;
		this.configuration = configuration;
	}

	public String getDriver() {
		return driver;
	}

	public String getUrl() {
		return url;
	}

	public String getUserName() {
		return userName;
	}

	public String getPassword() {
		return password;
	}

	public Properties getConfiguration() {
		return configuration;
	}

	public String getProperties(String name, String defaultValue) {
		if (configuration != null) {
			return configuration.getProperty(name, defaultValue);
		}
		return defaultValue;
	}

	public boolean isDefault() {
		return isDefault;
	}
}
